import request from '@/utils/request'
import {parseStrEmpty} from "@/utils/ruoyi";

// 查询用户列表
export function listUser(query) {
  return request({
    url: '/train/user/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getUser(userId) {
  return request({
    url: '/train/user/' + parseStrEmpty(userId),
    method: 'get'
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/train/user',
    method: 'put',
    data: data
  })
}

// 用户密码重置
export function resetUserPwd(userId, password) {
  const data = {userId, password}
  return request({
    url: '/train/user/resetPwd',
    method: 'put',
    data: data
  })
}
